FROM microsoft/dotnet:2.2-aspnetcore-runtime AS base
WORKDIR /app
EXPOSE 8888

FROM microsoft/dotnet:2.2-sdk AS build
WORKDIR /src
COPY ["CoreTest.csproj", "./"]
RUN dotnet restore "./CoreTest.csproj"
COPY . .
WORKDIR "/src/."
RUN dotnet build "CoreTest.csproj" -c Release -o /app

FROM build AS publish
RUN dotnet publish "CoreTest.csproj" -c Release -o /app/out

FROM base AS final
WORKDIR /app
COPY --from=publish /app/out .
ENTRYPOINT ["dotnet", "CoreTest.dll"]